import request from "@/axios/request";
import url from "@/axios/url";
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}mesTechnology/export`;
// 分页查询
export function getList (params = {}) {
  return request({
    url: `${mesUrl}mesTechnology`,
    method: "get",
    params,
  });
}
// 新增
export function rowCreate (data = {}) {
  return request({
    url: `${mesUrl}mesTechnology`,
    method: "post",
    data,
  });
}
// 修改
export function rowUpdate (data = {}) {
  return request({
    url: `${mesUrl}mesTechnology`,
    method: "put",
    data,
  });
}
// 删除
export function rowDel (id) {
  return request({
    url: `${mesUrl}mesTechnology/${id}`,
    method: "put",
  });
}
// 详情
export function rowDetail (id) {
  return request({
    url: `${mesUrl}mesTechnology/info/${id}`,
    method: "get",
  });
}

// 查询工艺类别:产品，系列列表
export function getTechnologyTypeList () {
  return request({
    url: `${adminUrl}dict/type/technology_type`,
    method: "get",
  });
}
// 查询工艺状态：0待发布，1启用，2停用列表
export function getTechnologyStatusList () {
  return request({
    url: `${adminUrl}dict/type/bom_status`,
    method: "get",
  });
}

// 根据型号或系列号获取工艺列表(包含默认列表)
export function getMesTechnologyList (data = {}) {
  return request({
    url: `${mesUrl}mesTechnology/getTechnologyList`,
    method: "post",
    data,
  });
}
// 根据型号或系列号获取工艺列表(包含默认列表)
export function getTechnologyListByCrossShop (data = {}) {
  return request({
    url: `${mesUrl}mesTechnology/getTechnologyListByCrossShop`,
    method: "post",
    data,
  });
}
// 根据型号或系列号获取工艺列表(包含默认列表)
export function saveProcessDetail (data = {}) {
  console.log(data, 3);
  return request({
    url: `${mesUrl}mesTechnologyProcess/saveProcessDetail`,
    method: "post",
    data,
  });
}
